package org.bambrikii.kbManager.kb2.managers.query5.q;

import java.text.MessageFormat;

public class ParsedQuery {
	private static String LIST_QUERY_TEMPLATE = "select {0} from {1} where {2}";
	private static String COUNT_QUERY_TEMPLATE = "select count({0}) from {1} where {2}";
	private final String select;
	private final String from;
	private final String where;

	public ParsedQuery(String select, String from, String where) {
		this.select = select;
		this.from = from;
		this.where = where;
	}

	public String getListQuery() {
		return MessageFormat.format(LIST_QUERY_TEMPLATE, select, from, where);
	}

	public String getCountQuery() {
		return MessageFormat.format(COUNT_QUERY_TEMPLATE, select, from, where);
	}
}
